const express = require('express');
const db = require('../db/index');
const Students = require('../models/studentsSchema');
// 创建路由器对象
const router = new express.Router();

router.get('/test', (req, res) => {
    console.log(req.query);
    res.send('test');
})
// 注册
// post 
router.post('/register', async (req, res) => {
    await db;
    console.log(req.body);
    const result = await Students.create(req.body);
    console.log(result);
    res.send("注册成功");
})


//暴露出去 
module.exports = router;